<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>欢迎页面</title>
    <style>
        body { font-family: Arial, sans-serif; margin: 50px; background: #f5f5f5;
            text-align: center; }
        .container { max-width: 600px; margin: 0 auto; padding: 40px; background: white;
            border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
        .welcome { color: #4CAF50; font-size: 28px; margin-bottom: 20px; }
        .info { color: #666; font-size: 16px; margin: 20px 0; }
        .actions { margin-top: 30px; }
        .btn { display: inline-block; padding: 10px 20px; margin: 0 10px;
            text-decoration: none; border-radius: 4px; color: white; }
        .logout { background: #f44336; }
        .login { background: #2196F3; }
        .btn:hover { opacity: 0.9; }
    </style>
</head>
<body>
<%
    String username = (String) session.getAttribute("currentUser");
    if (username == null) {
        response.sendRedirect("login.jsp");
        return;
    }
%>

<div class="container">
    <div class="welcome">欢迎您，<%= username %>！</div>
    <div class="info">您已成功登录用户管理系统</div>

    <div class="actions">
        <a href="<%= request.getContextPath() %>/userServlet?action=logout" class="btn logout">退出登录</a>
        <a href="<%= request.getContextPath() %>/login.jsp" class="btn login">返回登录页面</a>
    </div>

</div>
</body>
</html>